package backend.ro.msg.gillardon.dummyejb.implementation;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Stateless;

import backend.ro.msg.gillardon.dummyejb.HotelEJB;

@Stateless
public class HotelEJBBean implements HotelEJB {

  @Override
  public String getHotels(String city) {

    List<String> hotelsIsmaning = new ArrayList<String>();
    hotelsIsmaning.add("Zolelr");
    hotelsIsmaning.add("Neuwirt");
    hotelsIsmaning.add("Third Hotel");
    List<String> hotelsBretten = new ArrayList<String>();
    hotelsBretten.add("Achat");
    hotelsBretten.add("Other Hotel");
    List<String> hotels = new ArrayList<String>();
    hotels.addAll(hotelsBretten);
    hotels.addAll(hotelsIsmaning);
    if (city == null) {
      return "null";

    } else {
      switch (city) {
        case "Ismaning" :
          return hotelsIsmaning.toString();

        case "Bretten" :
          return hotelsBretten.toString();

        default :
          return hotels.toString();

      }
    }
  }

}
